﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace RainyPWS.Web.Admin
{
    public partial class Manage : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;
                FormsAuthenticationTicket ticket = id.Ticket;
                lblMsg.Text = string.Format("你的账号是 {0} :", ticket.Name);
            }
        }

        protected void lbtnLogout_click(object sender, EventArgs e)
        {
            FormsAuthentication.SignOut();
            Response.Redirect("/default.aspx");
        }

        public void ShowTitle(controls.Title.IconType iconType)
        {
            switch (iconType)
            {
                case controls.Title.IconType.Home:
                    hlHome.CssClass = "selected";
                    break;
                case controls.Title.IconType.Record:
                    hlRecord.CssClass = "selected";
                    break;
                case controls.Title.IconType.Tool:
                    hlTool.CssClass = "selected";
                    break;
                case controls.Title.IconType.Game:
                    hlGame.CssClass = "selected";
                    break;
                default:
                    hlHome.CssClass = "selected";
                    break;
            }
        }
    }
}